package com.lesama.buffered;

/*
    字符缓冲流的特有方法：
    public String readLine(): 读取一行字符串，读取到末尾返回null
    public void newLine(): 写出换行符（具有跨平台性）
 */

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class BufferedStreamDemo2 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("D:\\b.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("day14\\c.txt"));

        String line;
        while((line = br.readLine()) != null) {
            bw.write(line);
            bw.newLine();
        }
        br.close();
        bw.close();
    }
}